evalDC :: Eq a => (a -> Bool) -> (a -> b) -> (a -> [a]) -> ([b] -> b) -> a -> b


--evalDC :: (Eq a) => ([a]-> [a] -> Bool) -> ([a] -> [a] -> Bool) -> ([a] -> [a] -> [[a]]) -> ([Bool] -> Bool) -> ([a] -> [a] -> Bool)
evalDC isBase base split join (xs,ys) | isBase (xs,ys)  = base (xs,ys)
				        			  | otherwise = join (concatMap (evalDC isBase base split join) (split (xs,ys))
										
naza = evalDC (\(xs,ys) -> (xs == ys) || (ys == []) || (xs == [])) (\(xs,ys) -> all (`elem` xs) ys) (\(xs,ys) -> [(tail xs,init ys)]) 
	   (\(ms,zs) -> (head ms)||(last zs))
